// pages/mine/gzh/index.js
const app = getApp()
Page({
  ...app.globalData.function,
  data: {
    ...app.globalData.config,
    shopInfo:'',
  },

  onLoad(){
    let userInfo=this.getStorage('user_info')
    console.log(userInfo)
    let dataJson={
      token:userInfo.wx_openid,
      storageId:userInfo.storageId
    }
    this.ShopInfo(dataJson).then(res=>{
      if(res.resCode=='9999'){
        this.setData({
          shopInfo:res.data.header
        })
      }
    })
  },

  onShareAppMessage() {
    let userInfo=this.getStorage('user_info')
    let shopInfo=this.data.shopInfo
    return {
      title: `您的好友邀您使用【${this.data.project_cn}】,成为合作商家`,
      imageUrl: shopInfo.shop_logo,
      path: "/pagesUser/joinCooper/index?storageId="+this.data.shopInfo.id+"&recomId="+userInfo.id,
      success: (res) => { }
    }   
  },

  doPoster(){
     this.router('/pages/discover/index');
  }

})